---
title: HMR
---

When using the `hmr` feature, Angular destroys and creates the store on each change. We can work around this by using `persistStorage`:

```ts title="main.ts"
if (!environment.production) {
  persistState();
}
```
